/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pa165.pa165languageschoolclient;

import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;

/**
 *
 * @author Ultra
 */
@Provider
public class ObjectMapperProvider implements ContextResolver<ObjectMapper> {
    private final ObjectMapper defaultObjectMapper;

    public ObjectMapperProvider() {
        defaultObjectMapper = new ObjectMapper();
        defaultObjectMapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); 
    }

    @Override
    public ObjectMapper getContext(Class<?> type) {
         return defaultObjectMapper;
    }
    
}
